package com.jy.wms.web;

import com.joyi.gate.comm.SessionInfo;
import com.joyi.gate.safety.vo.UserInfo;
import com.jy.wms.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created by YUJIE on 2018/7/30.
 */
@Controller
@RequestMapping("/inOperation")
public class WmsinOperationPurchase {
    @Autowired
    SysMenuService menuService;

    @RequestMapping(value = "purchase/{menu}")
    public String purchase(@PathVariable("menu") String menu,  Model model) {
        model.addAttribute("functions",menuService.getFunctions(menu));
        return "inOperation/purchase/purchase";
    }
    @RequestMapping(value = "AddPurchase")
    public String addpurchase(Model model, HttpSession session) {
        UserInfo userinfo= (UserInfo) session.getAttribute(SessionInfo.USER_INFO);
        String ckmc=String.valueOf(userinfo.getUser().getOrgName());//仓库名称
        model.addAttribute("ckmc",ckmc);
        return "inOperation/purchase/addpurchase";
    }
    @RequestMapping(value = "EditPurchase")
    public String editpurchase(Model model, HttpSession session) {
        UserInfo userinfo= (UserInfo) session.getAttribute(SessionInfo.USER_INFO);
        String ckmc=String.valueOf(userinfo.getUser().getOrgName());//仓库名称
        model.addAttribute("ckmc",ckmc);
        return "inOperation/purchase/editpurchase";
    }
    @RequestMapping(value = "LookDetail")
    public String lookdetail() {
        return "inOperation/purchase/LookDetail";
    }
    @RequestMapping(value = "accessory")
    public String accessoryManage(String id, Model model) {
        model.addAttribute("id",id);
        return "inOperation/purchase/upload";
    }


}
